<!-- <p-button label="{{'Back'|translate}}" (onClick)="goback()"  iconPos="left" icon="fa fa-arrow-left"></p-button> -->
<h3>{{'Customer Property Management'|translate}}</h3>
<p-table #dt [columns]="selectedColumns" [value]="records" [paginator]="true" [responsive]="true" [rows]="10">
    <ng-template pTemplate="caption">
        <div class="row">
            <div class="col">
                <p-button (click)="reload()" label="{{'Reload'|translate}}" styleClass="ui-button-primary" iconPos="left" icon="fa fa-refresh"></p-button>
            </div>
            <div class="col">
                <p-multiSelect [options]="cols" [(ngModel)]="selectedColumns" optionLabel="header" selectedItemsLabel="{0} columns selected"
                    [style]="{minWidth: '200px'}" defaultLabel="Choose Columns"></p-multiSelect>
            </div>
            <div class="col">
                <div style="text-align: right">

                    <input type="text" pInputText size="20" placeholder="{{'Global Filter'|translate}}" (input)="dt.filterGlobal($event.target.value, 'contains')"
                        style="width:auto">
                    <i class="fa fa-search" style="margin:4px 4px 0 0"></i>
                </div>
            </div>


        </div>


    </ng-template>
    <ng-template pTemplate="header" let-columns>
        <tr>
            <th *ngFor="let col of columns" [pSortableColumn]="col.field">
                {{col.header}}
                <p-sortIcon [field]="col.field"></p-sortIcon>
            </th>
        </tr>

    </ng-template>
    <ng-template pTemplate="body" let-rowData let-columns="columns">
        <tr [pSelectableRow]="rowData">
            <td *ngFor="let col of columns" [ngSwitch]="col.field">
                <span *ngSwitchCase="'lot'">
                    <a href="javascript:void(0)" (click)="onViewRow(rowData)">{{rowData[col.field]}}</a>
                </span>
                <span *ngSwitchDefault>
                    {{rowData[col.field]}}
                </span>
            </td>

        </tr>
    </ng-template>
</p-table>